/*
 * @Author: ylq
 * @Date: 2022-09-13 11:49:47
 * @Desc: 生产环境配置
 * @Last Modified by: ylq
 * @Last Modified time: 2023-07-04 17:17:44
 */
import { mergeConfig } from 'vite';
import baseConfig from './vite.config.base';
import configCompressPlugin from './plugin/compress';
import configArcoResolverPlugin from './plugin/arcoResolver';

export default mergeConfig(
  {
    mode: 'production',
    plugins: [
      configCompressPlugin('gzip'),
      // configVisualizerPlugin(),
      configArcoResolverPlugin()
      // configStyleImportPlugin(),
      // configImageminPlugin(),
    ],
    build: {
      rollupOptions: {
        output: {
          // assetFileNames: "[hash].[name].[ext]",
          manualChunks: {
            //vue: ['vue', 'vue-router', 'pinia', '@vueuse/core']
            vue: ['vue', 'vue-router', 'pinia']
          }
        }
      },
      chunkSizeWarningLimit: 2000,
      minify: 'terser',
      terserOptions: {
        compress: {
          drop_console: true,
          drop_debugger: true
        }
      }
    }
  },
  baseConfig
);
